package cn.tedu.heightandpoint.user.controller;

import cn.tedu.heightandpoint.base.response.JsonResult;
import cn.tedu.heightandpoint.user.pojo.dto.UserLoginParam;
import cn.tedu.heightandpoint.user.pojo.vo.UserVO;
import cn.tedu.heightandpoint.user.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    UserService userService;
    @PostMapping("login")
    public JsonResult login(@RequestBody UserLoginParam userLoginParam){
        log.debug("开始处理登录请求，参数：{}",userLoginParam);
        UserVO userVO = userService.login(userLoginParam);
        return JsonResult.ok(userVO);
    }
}
